package com.svn.operate;

import com.svn.operate.impl.LinuxConnection;
import com.svn.util.GeneratePasswd;
import com.svn.util.XMLReader;

public class SVNConnectMange {

	private static SVNConnect connect;

	public static SVNConnect getDefaulSVNConnect() {
		if (connect == null) {
			connect = new LinuxConnection();
			connect.createConnect(XMLReader.getInstance()
					.getElementValueByName("hostname"), Integer
					.parseInt(XMLReader.getInstance().getElementValueByName(
							"port")), XMLReader.getInstance()
					.getElementValueByName("username"), XMLReader.getInstance()
					.getElementValueByName("password"));
		}
		return connect;
	}
	
	public static void disSVNConnect(){
		if(connect != null){
			connect.disConnect();
		}
	}
	
	public static void main(String[] args) {
		System.out.println(GeneratePasswd.generatePassword(8));
	}
}
